<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>javascript学习001</title>

<script>
//点击按钮1显示图片1
function img_change(img_count) {
var img_source="";
	//根据传入的参数更换对象图片
	switch (img_count){
	case 1:
		img_source="xh-01.jpg";
	break;
	case 2:
		img_source="xh-02.jpg";	
	break;
	}
	
	document.getElementById("xuehua_show").src=img_source;
		
}
</script>
</head>
<body>
<p id="info">
通过JavaScript控制载入图片，按钮1载入雪花1，按钮2载入雪花2
</p>
<img id="xuehua_show" src="" > </img>
<button onclick="img_change(1)">第一张图片</button>
<button onclick="img_change(2)">第二张图片</button>

<button id="ChangeColor" onclick="document.getElementById('info').style.color='red'">变色</button>
</body>
</html>
